Skip to content

ARM: pl35x-nand-controller: Fix subpage read performance#221

Merged
gratian merged 1 commit intoni:nilrt/master/6.6from
HatsyRei:nilrt/master/6.6
Apr 8, 2025
Merged

ARM: pl35x-nand-controller: Fix subpage read performance#221
gratian merged 1 commit intoni:nilrt/master/6.6from
HatsyRei:nilrt/master/6.6

Conversation

@HatsyRei
Copy link
Copy Markdown
Member

@HatsyRei HatsyRei commented Apr 7, 2025

When timing sha256sum operations on Bluefin devices running Linux 6.6, a discrepancy in system CPU time was found:

Linux 4.1:

admin@cDAQ9189-215689B:~# time sha256sum /dev/mtdblock8
c0660b8c34d025943654d732aad8b04083b3d0dd69a114ff95df74217d111f2e  /dev/mtdblock8
 
real    0m9.416s
user    0m5.440s
sys     0m3.920s

Linux 6.6

admin@cDAQ9189-215689B:~# time sha256sum /dev/mtdblock8
c0660b8c34d025943654d732aad8b04083b3d0dd69a114ff95df74217d111f2e  /dev/mtdblock8
 
real    0m24.671s
user    0m5.639s
sys     0m18.025s

The issue was traced back to nand subpage read implementation, where a full raw page read was performed instead of a subpage read. This is resolved by replacing the nand_monolithic_read_page_raw with a nand_read_page_op call and passing the corresponding read length and data offset. Change tested on cDAQ-9189:

admin@cDAQ9189-215689B:/boot# time sha256sum /dev/mtdblock8
c0660b8c34d025943654d732aad8b04083b3d0dd69a114ff95df74217d111f2e  /dev/mtdblock8
 
real    0m13.199s
user    0m5.813s
sys     0m6.477s

Previous subpage read implementation found to incur performance penalty.
This commit rectifies the issue by calling nand_read_page_op along with
read length, data offset arguments, instead of doing a raw page read via
nand_monolithic_read_page_raw.

Signed-off-by: HatsyRei <yan.huan.chng@emerson.com>
@chaitu236 chaitu236 requested a review from a team April 8, 2025 15:39
@gratian gratian merged commit bdc6c24 into ni:nilrt/master/6.6 Apr 8, 2025
1 check passed
@gratian
Copy link
Copy Markdown

gratian commented Apr 8, 2025

Cherry-picked in nilrt/master/6.12 as b9fd08c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants